package com.tuocent.dagv2.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tuocent.dagv2.common.AjaxResult;
import com.tuocent.dagv2.entity.DictionaryClass;
import com.tuocent.dagv2.mapper.DictionaryClassMapper;
import com.tuocent.dagv2.service.IDictionaryClassService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 词典类别 服务实现类
 * </p>
 *
 * @author Vincent
 * @since 2025-07-30
 */
@Service
public class DictionaryClassServiceImpl extends ServiceImpl<DictionaryClassMapper, DictionaryClass> implements IDictionaryClassService {

    @Override
    public AjaxResult getDictionaryClassData(String model) {
        List<DictionaryClass> data = list(
                new QueryWrapper<DictionaryClass>()
                        .eq("model", model)
                        .eq("isshow", "1").orderByAsc("idx"));
        return AjaxResult.success(data);
    }
}
